#ifndef PARTICLE_H_
#define PARTICLE_H_
#include "../GameObject/Component.h"
#include "../Math/Vector3.h"

namespace Pantsu {

	class ParticleComponent : public Component {
	
	public:
		ParticleComponent();
		~ParticleComponent();

		ParticleComponent( const ParticleComponent &i_particlecomponent ){};
		ParticleComponent operator = ( ParticleComponent &i_particlecomponent ) {}
	
	public: 
		/* set / get */
		inline void SetAcceleration( const Vector3 &acceleration ) {
			m_v3Acceleration = acceleration;
		}

		inline void SetVelocity( const Vector3 &vel ) {
			m_v3Velocity = vel;
		}

		inline void SetMass( float i_mass ) {
			m_fInverseMass = ( 1.0f / i_mass );
		}

		inline Vector3 &GetVelocity() {
			return m_v3Velocity;
		}

		inline Vector3 &GetAcceleration() {
			return m_v3Acceleration;
		}

		inline float GetMass() const {
			return ( 1.0f / m_fInverseMass );
		}

		inline Vector3 &GetPosition() {
			return m_v3Position;
		}

	public:
		void AddForce( const Vector3 &i_force );
		void Update( float i_deltaTime );
		
		inline void ClearAccumulation() {
			m_v3ForceAcculated.X = 0.0f;
			m_v3ForceAcculated.Y = 0.0f;
			m_v3ForceAcculated.Z = 0.0f;
		}

	private:
		void PerformIntergration( float i_duration );

	private:
		Vector3 m_v3Position;
		Vector3 m_v3Velocity;
		Vector3 m_v3Acceleration;
		Vector3 m_v3ForceAcculated;
		float   m_fInverseMass;
		float   m_fDamping;
	};
}

#endif